<template>
  <div class="tianqi">
    <div id="he-plugin-standard"></div>
  </div>
</template>
<script>
export default {
  name: '',
  mounted() {
    this.weathers()
  },
  methods: {
    // 获取天气
    weathers() {
      // 到和风天气官网设计和下载 https://widget.qweather.com/
      window.WIDGET = {
        CONFIG: {
          layout: '1',
          width: '500',
          height: '300',
          background: '1',
          dataColor: 'FFFFFF',
          borderRadius: '5',
          key: '9f5cb7d9725e483f95457d258eaba2cb',
        },
      }
      const script = document.createElement('script')
      script.type = 'text/javascript'
      script.src =
                'https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0'
      document.getElementsByTagName('head')[0].appendChild(script)
    },
  },
}
</script>

<style  scoped>

</style>
